<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<body>
<div id="header-navbar" class="top-navbar navbar-fixed-top" th:fragment="web-navbar">
    <div class="headerNav ">
        <div class="ui menu ">
            <ul class="hleft">
                <li class="logo2">
                    <span style="font-size: 19px;">
                        <a th:href="@{/}">
                            <img th:src="@{/img/logo-happyoj.png}" style="vertical-align: middle;">
                            <span></span>
                        </a>
                    </span>
                </li>
                <li class=" nav_menu">
                    <a th:href="@{/problemset}" class="item" >[[#{problems}]]</a>
                </li>
                <li class=" nav_menu">
                    <a th:href="@{/problemset/status}" class="item">[[#{status}]]</a>
                </li>
                <li class="t_c_contests nav_menu">
                    <a th:href="@{/contests}" class="item">[[#{contests}]]</a>
                </li>
                <li class=" nav_menu">
                    <a th:href="@{/problemset/standings}" class="item">[[#{standings}]]</a>
                </li>
                <li class="nav_menu">
                    <a th:href="@{/topics}" class="item">[[#{topic}]]</a>
                </li>
                <li class="nav_menu">
                    <a th:href="@{/tags}" class="item">[[#{tag}]]</a>
                </li>
                <!--
                <li class="t_c_faq nav_menu">
                    <a th:href="@{/topic/9}" class="item">[[#{faq}]]</a>
                </li>
                -->
                <li class="t_c_faq nav_menu">
                    <a th:href="@{/ide}" class="item">[[#{ide}]]</a>
                </li>
                <li class="t_c_faq nav_menu">
                    <a th:href="@{/tools}" class="item">[[#{tools}]]</a>
                </li>
                <!--
                <li class="searchbox">
                    <div class="searchTool">
                        <form method="get" action="search" name="headSearchForm" id="headSearchForm">
                            <input class="txtSearch" id="headq" name="word" type="text" x-webkit-speech />
                        </form>
                    </div>
                </li>-->
            </ul>
            <ul class="hright" th:unless="${session.session_username}">
                <li class="nav_menu">
                    <a href="/enter" class="enter item">[[#{login}]]</a>
                </li>
                <li class="nav_menu" style="margin:0 12px 16px 0;">
                    <a href="/registration" class="register item">[[#{register}]]</a>
                </li>
            </ul>
            <ul class="hright" th:if="${session.session_username}">
                <li class="t_c_mail rightmenu nav_menu">
                    <a href="/mails" class="item"><img id="mails_nav" class="mail" th:src="@{/img/mail.png}" onmouseover="this.src='/img/mail.png'" onmouseout="this.src='/img/mail.png'" /></a>
                    <ul class="t_c_box mail_box t_c_mail_box" style="display: none;">
                        <li>
                            <a thref="/mails">[[#{mails.recv}]]<span title="new mails" class="new-mail-count">(0)</span></a>
                        </li>
                        <li>
                            <a href="/mails/send">[[#{mails.send}]]</a>
                        </li>
                        <li>
                            <a href="/mails/new">[[#{mails.new}]]</a>
                        </li>
                    </ul>
                </li>
                <li class="t_cprofile rightmenu nav_menu" style="margin:0;padding:0;">
                    <a th:href="@{/profile/{username}(username=${session.session_username})}" class="item" style="margin:0;padding:3px 8px 0px 8px;">
                        <img class="mail small-avatar" th:src="${session.session_user_avatar_url}" >
                        <span class="caret" style="margin:0 12px 16px 0;"></span>
                    </a>
                    <ul class="t_c_box profile_box t_cprofile_box" style="display: none;">
                        <li>
                            <a class="profile-item profile-home" th:href="@{/profile/{username}(username=${session.session_username})}">[[#{profile}]]</a>
                        </li>
                        <li>
                            <a class="profile-item profile-setting" href="/settings">[[#{settings}]]</a>
                        </li>
                        <li>
                            <a class="profile-item profile-logout" href="/logout">[[#{logout}]]</a>
                        </li>
                    </ul>
                </li>
                <script type="text/javascript">
                    $(function(){
                        $(".t_cprofile").mouseover(function(){$(".t_cprofile_box").show();});
                        $(".t_cprofile").mouseout(function(){$(".t_cprofile_box").hide();});
                        $(".t_c_mail").mouseover(function(){$(".t_c_mail_box").show();});
                        $(".t_c_mail").mouseout(function(){$(".t_c_mail_box").hide();});
                    });

                    $(document).ready(function() {
                        OnlineJudge.updateMails(0);
                        OnlineJudge.ping();
                    })
                </script>
            </ul>
        </div>
    </div>
    <script th:src="@{/data/js/stat.js}"></script>
</div>
<div id="footer" th:fragment="web-footer">
    <div class="footer-desc" th:include="freemarker/footer::web-footer-desc"></div>
    <div class="footer-link">
        <a th:href="@{/admin}" title="administrator">Admin</a>&nbsp;|
        <a href="?lang=zh_CN" class="locale-zh" title="Chinese">中文</a>&nbsp;|
        <a href="?lang=en_US" class="locale-en" title="English">English</a><br>
    </div>
    <div class="sidebar-online-users" style="text-align:left;padding: 6px;"></div>
    <link rel="stylesheet" th:href="@{/js/poshytip/tip-whitesimple/tip-whitesimple.css}" type="text/css" />
    <script type="text/javascript" th:src="@{/js/poshytip/jquery.poshytip.js}"></script>
    <script type="text/javascript" th:src="@{/js/scrolltotop.js}"></script>
    <script type="text/javascript">
        $(document).ready(function() {
            scrolltotop.offset(100,120);
            scrolltotop.init();
            OnlineJudge.saveUrl();
            OnlineJudge.onlineUsers();
            OnlineJudge.userTip();
        });
    </script>
</div>
</body>
</html>